home *** CD-ROM | disk | FTP | other *** search
/ VRML 2.0 Sourcebook (2nd Edition) / VRML 2.0 Sourcebook CD [md5 fed90f4f9c39d5a60d477058775c7e21].iso / book / unix / ch30 / 30fig01.wrl < prev    next >
Text File  |  1996-09-23  |  1KB  |  49 lines

  1. #VRML V2.0 utf8
  2. # The VRML 2.0 Sourcebook
  3. # Copyright [1997] By
  4. # Andrea L. Ames, David R. Nadeau, and John L. Moreland
  5. Group {
  6.     children [
  7.         Background {
  8.             skyColor    [ 1.0 0.0 0.8,  0.5 0.0 0.8,  0.0 0.0 0.8 ]
  9.             skyAngle    [ 1.309, 1.571 ]
  10.             groundColor [ 0.0 0.0 0.1,  0.0 0.1 0.3,  0.3 0.3 0.6 ]
  11.             groundAngle [ 1.309, 1.571 ]
  12.         },
  13.     # Floor
  14.         Shape {
  15.             appearance Appearance {
  16.                 material Material { }
  17.             }
  18.             geometry Box { size 2.0 0.01 0.5 }
  19.         },
  20.     # Animating red ball
  21.         Transform {
  22.             translation 0.0 1.1 0.0
  23.             children DEF BallTransform Transform {
  24.                 children Shape {
  25.                     appearance Appearance {
  26.                         material Material {
  27.                             diffuseColor 1.0 0.3 0.3
  28.                         }
  29.                     }
  30.                     geometry Sphere { radius 0.1 }
  31.                 }
  32.             }
  33.         },
  34.     # Animation clock
  35.         DEF Clock TimeSensor {
  36.             cycleInterval 4.0
  37.             loop TRUE
  38.         },
  39.     # Script
  40.         DEF Mover Script {
  41.             url "move1.js"
  42.             eventIn  SFFloat set_fraction
  43.             eventOut SFVec3f value_changed
  44.         }
  45.     ]
  46. }
  47. ROUTE Clock.fraction_changed TO Mover.set_fraction
  48. ROUTE Mover.value_changed    TO BallTransform.set_translation
  49.